package com.info.zhiduoduo.weixin.controller;

import com.info.zhiduoduo.common.constants.SmartResult;
import com.info.zhiduoduo.common.formbean.BaseSimpleFormBean;
import com.info.zhiduoduo.weixin.formbean.evaluate.SaveEvaluateFormBean;
import com.info.zhiduoduo.weixin.service.EvaluateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "微信端-评价")
@RestController
@RequestMapping("/evaluate")
public class EvaluateController {

	@Resource
	EvaluateService evaluateService;

	@ApiOperation("微信端新增评价")
	@PostMapping("/saveEvaluate")
	public SmartResult saveEvaluate(@RequestBody BaseSimpleFormBean<SaveEvaluateFormBean> formBean) {
		return evaluateService.saveEvaluate(formBean);
	}

	@ApiOperation("微信端查看登录者没有评价过")
	@PostMapping("/queryWhetherEvaluate")
	public SmartResult queryWhetherEvaluate(@RequestBody BaseSimpleFormBean formBean) {
		return evaluateService.queryWhetherEvaluate(formBean);
	}

	@ApiOperation("微信端评价不在提醒")
	@PostMapping("/noReminders")
	public SmartResult noReminders(@RequestBody BaseSimpleFormBean formBean) {
		return evaluateService.noReminders(formBean);
	}
}
